package com.rd.sys.dto.commmon.base;

import baseproj.common.constants.BaseEnum;

import com.fasterxml.jackson.annotation.JsonProperty;

public final class EyeResult {

    @JsonProperty("RspCode")
    private String rspCode;

    @JsonProperty("RspDesc")
    private String rspDesc;

    public EyeResult(ResultDefine response) {
        this.rspCode = response.getCode();
        this.rspDesc = response.getName();
    }

    public String getRspCode() {
        return rspCode;
    }

    public void setRspCode(String rspCode) {
        this.rspCode = rspCode;
    }

    public String getRspDesc() {
        return rspDesc;
    }

    public void setRspDesc(String rspDesc) {
        this.rspDesc = rspDesc;
    }

    public enum ResultDefine implements BaseEnum {
        // ***************公共部分******************//
        COMMON_SUCCESS("000000", "处理成功"), COMMON_OTHER_ERROR_CLIENT("009998", "其它错误，由客户端请求引起"), COMMON_OTHER_ERROR_SERVER(
                "009999", "其它错误，由服务端自行解释"),

        // ***************业务数据同步部分******************//
        SYNC_HEAD_RESOLVING_ERROR("000001", "消息头无法解析"), SYNC_HEAD_DEFINED_ERROR("000002", "消息头格式不满足定义"), SYNC_BODY_RESOLVING_ERROR(
                "000003", "消息体无法解析"), SYNC_BODY_DEFINED_ERROR("000004", "消息体格式不满足定义"), SYNC_SUBSCRIPTION_MAX_PROJECT_ERROR(
                "000051", "订购关系已达到最大项目个数"), SYNC_SUBSCRIPTION_MAX_SCHEME_ERROR("000052", "订购关系已达到最大方案个数"), SYNC_SUBSCRIPTION_MAX_RESULT_ERROR(
                "000053", "订购关系已达到最大结果个数"), SYNC_SUBSCRIPTION_OVERDUE_ERROR("000054", "订购关系已过期"), SYNC_SUBSCRIPTION_NOT_NORMAL_ERROR(
                "000055", "订购关系状态非正常"), SYNC_SUBSCRIPTION_NOT_USER_ERROR("000056", "无该用户的订购关系"), SYNC_USER_NOT_EXIST_ERROR(
                "000057", "无该用户的基础消息"), SYNC_PROJECT_EXIST_ERROR("000101", "项目编号已存在"), SYNC_PROJECT_NOT_EXIST_ERROR(
                "000102", "项目编号不存在"), SYNC_SCHEME_EXIST_ERROR("000103", "方案编号已存在"), SYNC_SCHEME_NOT_EXIST_ERROR(
                "000104", "方案编号不存在"), SYNC_RESULT_EXIST_ERROR("000105", "结果编号已存在"), SYNC_RESULT_NOT_EXIST_ERROR(
                "000106", "结果编号不存在"), SYNC_RESULT_FILE_DEFINED_ERROR("000107", "结果文件不满足定义"),

        // ***************客户端激活部分******************//
        ACTIVATE_AUTH_OTHER_ERROR("010001", "激活码鉴权失败：其它信息不一致"), ACTIVATE_AUTH_CODE_ERROR("010002", "激活码鉴权失败：激活码错误或不存在"), ACTIVATE_AUTH_MAC_ERROR(
                "010003", "激活码鉴权失败：MAC地址和初次注册不一致"),

        // ***************嵌入登录部分******************//
        AUTH_LOGIN_FAIL("910001", "客户端嵌入登录失败"), AUTH_SESSION_VOERDUE("910002", "Session过期"), AUTH_LOGIN_FAIL_RAND_NOT_EXIST(
                "910003", "客户端嵌入登录失败:随机码不存在"), AUTH_LOGIN_FAIL_RAND_IDENTICAL("910004", "客户端嵌入登录失败:随机码不一致"), AUTH_LOGIN_FAIL_USER_NOT_EXIST(
                "910005", "客户端嵌入登录失败:用户不存在"), AUTH_LOGIN_FAIL_USER_IDENTICAL("910006", "客户端嵌入登录失败:用户不一致"), AUTH_LOGIN_FAIL_PROTOCOL_ERROR(
                "910007", "客户端嵌入登录失败:不满足协议"), AUTH_LOGIN_PROJECT_SCHEME_NOTFIND("910008", "客户端嵌入登录失败:未找到对应的项目或方案"), AUTH_LOGIN_READ_REQUEST_ERROR(
                "910009", "客户端嵌入登录失败:请求消息读取有误");

        // 以下为枚举本身定义
        private final String code;

        private final String name;

        ResultDefine(String code, String name) {
            this.code = code;
            this.name = name;
        }

        @Override
        public String getCode() {
            return code;
        }

        @Override
        public String getName() {
            return name;
        }

    }

}
